<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddColumnRelationCodeToCruiseCheckTaskGroups extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('cruise_check_task_groups', function (Blueprint $table) {
            $table->string('relationCode', 32)->after('userId')->default('')->comment('关联业务单据编号');
            $table->index('relationCode', 'idx_relationCode');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('cruise_check_task_groups', function (Blueprint $table) {
            $table->dropColumn('relationCode');
        });
    }
}
